package com.ruoyi.caigou.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 采购订单对象 finer_buy_order
 *
 * @author lvql
 * @date 2024-11-02
 */
public class BuyOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Integer id;

    /**
     * 单据编号
     */
    @Excel(name = "单据编号")
    private String code;

    /**
     * 源单编号
     */
    @Excel(name = "源单编号")
    private String sourceCode;

    /**
     * 总金额
     */
    @Excel(name = "总金额")
    private BigDecimal totalAmount;

    /**
     * 支付状态(0-未支付，1-部分支付，2-支付完成）
     */
    @Excel(name = "支付状态(0-未支付，1-部分支付，2-支付完成）")
    private Integer payStatus;

    /**
     * 入库状态（0-未入库，1-部分，2-完全）
     */
    @Excel(name = "入库状态", readConverterExp = "0=-未入库，1-部分，2-完全")
    private Integer storeStatus;

    /**
     * 单据日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date docTime;

    /**
     * 单据阶段
     */
    @Excel(name = "单据阶段")
    private Integer docStage;

    /**
     * 制单人id
     */
    @Excel(name = "制单人id")
    private Integer docMakeUserId;

    /**
     * 供应商id
     */
    @Excel(name = "供应商id")
    private Integer supId;


    /**
     * 业务员
     */
    @Excel(name = "业务员")
    private Integer businessUserId;


    /**
     * 审核结果
     */
    @Excel(name = "审核结果")
    private Integer approvalResult;

    /**
     * 审批意见
     */
    @Excel(name = "审批意见")
    private String approvalRemark;

    /**
     * 审核人
     */
    @Excel(name = "审核人")
    private Integer approvalUserId;

    /**
     * 是否生效
     */
    @Excel(name = "是否生效")
    private Integer isEffect;

    /**
     * 是否关闭
     */
    @Excel(name = "是否关闭")
    private Integer isClose;

    /**
     * 是否取消
     */
    @Excel(name = "是否取消")
    private Integer isCancel;

    private String supName;
    private String businessUserName;
    private String docMakeUserName;
    private String approvalUserName;

    /*预付金额*/
    private BigDecimal advanceAmount;
    /*已入库数量*/
    private Integer inventoryQuantity;

    /*已入库金额*/
    private BigDecimal inventoryAmount;
    /*已结算金额*/
    private BigDecimal paidAmount;


    /*用户数据库查表 检查金额的字段*/
    private boolean checkAmount = false;

    public boolean isCheckAmount() {
        return checkAmount;
    }

    public void setCheckAmount(boolean checkAmount) {
        this.checkAmount = checkAmount;
    }

    public BigDecimal getAdvanceAmount() {
        return advanceAmount;
    }

    public void setAdvanceAmount(BigDecimal advanceAmount) {
        this.advanceAmount = advanceAmount;
    }

    public Integer getInventoryQuantity() {
        return inventoryQuantity;
    }

    public void setInventoryQuantity(Integer inventoryQuantity) {
        this.inventoryQuantity = inventoryQuantity;
    }

    public BigDecimal getInventoryAmount() {
        return inventoryAmount;
    }

    public void setInventoryAmount(BigDecimal inventoryAmount) {
        this.inventoryAmount = inventoryAmount;
    }

    public BigDecimal getPaidAmount() {
        return paidAmount;
    }

    public void setPaidAmount(BigDecimal paidAmount) {
        this.paidAmount = paidAmount;
    }

    public String getApprovalUserName() {
        return approvalUserName;
    }

    public void setApprovalUserName(String approvalUserName) {
        this.approvalUserName = approvalUserName;
    }

    public String getDocMakeUserName() {
        return docMakeUserName;
    }

    public void setDocMakeUserName(String docMakeUserName) {
        this.docMakeUserName = docMakeUserName;
    }

    public String getSupName() {
        return supName;
    }

    public void setSupName(String supName) {
        this.supName = supName;
    }

    public String getBusinessUserName() {
        return businessUserName;
    }

    public void setBusinessUserName(String businessUserName) {
        this.businessUserName = businessUserName;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setSourceCode(String sourceCode) {
        this.sourceCode = sourceCode;
    }

    public String getSourceCode() {
        return sourceCode;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setStoreStatus(Integer storeStatus) {
        this.storeStatus = storeStatus;
    }

    public Integer getStoreStatus() {
        return storeStatus;
    }

    public void setDocTime(Date docTime) {
        this.docTime = docTime;
    }

    public Date getDocTime() {
        return docTime;
    }

    public void setDocStage(Integer docStage) {
        this.docStage = docStage;
    }

    public Integer getDocStage() {
        return docStage;
    }

    public void setDocMakeUserId(Integer docMakeUserId) {
        this.docMakeUserId = docMakeUserId;
    }

    public Integer getDocMakeUserId() {
        return docMakeUserId;
    }

    public void setSupId(Integer supId) {
        this.supId = supId;
    }

    public Integer getSupId() {
        return supId;
    }

    public void setBusinessUserId(Integer businessUserId) {
        this.businessUserId = businessUserId;
    }

    public Integer getBusinessUserId() {
        return businessUserId;
    }

    public void setApprovalResult(Integer approvalResult) {
        this.approvalResult = approvalResult;
    }

    public Integer getApprovalResult() {
        return approvalResult;
    }

    public void setApprovalRemark(String approvalRemark) {
        this.approvalRemark = approvalRemark;
    }

    public String getApprovalRemark() {
        return approvalRemark;
    }

    public void setApprovalUserId(Integer approvalUserId) {
        this.approvalUserId = approvalUserId;
    }

    public Integer getApprovalUserId() {
        return approvalUserId;
    }

    public void setIsEffect(Integer isEffect) {
        this.isEffect = isEffect;
    }

    public Integer getIsEffect() {
        return isEffect;
    }

    public void setIsClose(Integer isClose) {
        this.isClose = isClose;
    }

    public Integer getIsClose() {
        return isClose;
    }

    public void setIsCancel(Integer isCancel) {
        this.isCancel = isCancel;
    }

    public Integer getIsCancel() {
        return isCancel;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("code", getCode())
                .append("sourceCode", getSourceCode())
                .append("totalAmount", getTotalAmount())
                .append("payStatus", getPayStatus())
                .append("storeStatus", getStoreStatus())
                .append("docTime", getDocTime())
                .append("docStage", getDocStage())
                .append("docMakeUserId", getDocMakeUserId())
                .append("supId", getSupId())
                .append("businessUserId", getBusinessUserId())
                .append("approvalResult", getApprovalResult())
                .append("approvalRemark", getApprovalRemark())
                .append("approvalUserId", getApprovalUserId())
                .append("isEffect", getIsEffect())
                .append("isClose", getIsClose())
                .append("isCancel", getIsCancel())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
